Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <script src="../../ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> $(document).ready(function(){ $("div:not(:has(h1))").css("background-color","yellow"); }); </script> </head> <body> <div> <h1>This is a heading (h1)</h1> <p>This is a paragraph.</p> </div> <div> <h2>This is a heading (h2)</h2> <p>This is a paragraph.</p> </div> <div> <h3>This is a heading (h3)</h3> <p>This is a paragraph.</p> </div> </body> <!-- Mirrored from www.w3schools.com/jquery/tryit.asp?filename=tryjquery_sel_has3 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:08:22 GMT --> </html>
Result:
Try it Yourself - © w3schools.com